package com.site.common.aspect;

import org.aspectj.lang.ProceedingJoinPoint;

import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;

/**
 * 自定义注解的抽象类
 */
public abstract class AbstractAspect implements Aspect<Object> {

    /**
     * 公共调用
     * @param joinPoint
     * @param method
     * @return
     * @throws Throwable
     */
    @Override
    public Object doHandlerAspect(ProceedingJoinPoint joinPoint, Method method, HttpServletRequest request) throws Throwable {
        // 执行抽象方法 execute 的实现体
        return this.execute(joinPoint,method,request);
    }

    protected abstract Object execute(ProceedingJoinPoint joinPoint, Method method, HttpServletRequest request);
}
